function printPink(str)
    print("<color=pink>" .. str .. "</color>")
end

function printNavy(str)
    print("<color=Navy>" .. str .. "</color>")
end

function printMagenta(str)
    print("<color=Magenta>" .. str .. "</color>")
end

function printBlue(str)
    print("<color=cyan>" .. str .. "</color>")
end

--绿色打印
function printGreen(str)
    print("<color=green>" .. str .. "</color>")
end

--红色打印-
function printRed(str)
    print("<color=red>" .. str .. "</color>")
end

--黄色打印
function printYellow(str)
    print("<color=yellow>" .. str .. "</color>")
end

--橘色打印
function printOrange(str)
    print("<color=orange>" .. str .. "</color>")
end

---@class Utility
Utility = Utility or {} ;

function Utility.LuaMemory()
    print(collectgarbage("count"))
    for k, v in pairs(_G) do
        if type(v) == "table" and k ~= "_G" then
            for key in pairs(v) do
                print("  " .. k .. "." .. key)
            end
        end
    end
end

---@param str string
---@param sep string
---@return table
function Utility.Split(str, sep)
    local sep, fields = sep or ",", {}
    local pattern = string.format("([^%s]+)", sep)
    string.gsub(str, pattern, function(c) table.insert(fields, c) end)
    return fields
end

---@param params table
---@return string
function Utility.Format(str, params)
    if (params == nil or str == nil) then
        return str
    end

    for i = 1, #params do
        local strId = string.format("{%d}", i - 1)
        str = string.gsub(str, strId, params[i])
    end
    return str
end

---@param str string
---@return boolean
function Utility.IsNullOrEmpty(str)
    if (str == nil or str == "") then
        return true
    end
    return false
end

---@param strTable table
---@return table
function Utility.ToNumberList(strTable)
    local numbers = {}
    if (strTable == nil) then
        return numbers
    end
    for i = 1, #strTable do
        table.insert(numbers, tonumber(strTable[i]))
    end
    return numbers
end

---@param str string
---@param sep string
---@return table
function Utility.StringToNumbers(str, sep)
    local strTable = Utility.Split(str, sep)
    return Utility.ToNumberList(strTable)
end

---@param modulePath string
---@return table
function Utility.NewLuaScript(modulePath)
    local tableClass = require(modulePath);
    return tableClass.new();
end